Socket
Socket
Sign inDemoInstall

titleize

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

titleize

Capitalize every word in a string: `unicorn cake` → `Unicorn Cake`


Version published
Weekly downloads
2.7M
decreased by-0.76%
Maintainers
1
Weekly downloads
 
Created

What is titleize?

The titleize npm package is a utility for converting strings to title case, where the first letter of each word is capitalized. It is useful for formatting titles or headings in text content.

What are titleize's main functionalities?

Title casing a single string

This feature allows you to convert a single string to title case. It capitalizes the first letter of each word while keeping the rest of the letters in lowercase.

const titleize = require('titleize');
console.log(titleize('mr. jones is from new york.')); // 'Mr. Jones Is From New York.'

Title casing an array of strings

This feature allows you to map over an array of strings and convert each one to title case.

const titleize = require('titleize');
const titles = ['mr. jones', 'dr. smith'];
const titleCased = titles.map(title => titleize(title));
console.log(titleCased); // ['Mr. Jones', 'Dr. Smith']

Ignoring certain words from being capitalized

This feature allows you to specify an array of words to ignore during the title casing process, so they remain in lowercase.

const titleize = require('titleize');
titleize('the wind in the willows', { ignore: ['the', 'in'] }); // 'The Wind in the Willows'

Other packages similar to titleize

Keywords

FAQs

Package last updated on 31 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc